package com.zsw.demo01;

import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        Map<String,String[]> y = Yunnan.y;
        Set shengFen = y.keySet();
        for (Object n : shengFen){
            System.out.println(n + " ");
        }
        System.out.println();
        Scanner s = new Scanner(System.in);
        while (true){
            System.out.println("请输入省份：");
            String sf = s.next();


            if(!y.containsKey(sf)){
                System.out.println("输入错误，请您重新输入");
            }else {
                System.out.println("您输入的省份是：" + sf);
                String[] city = (String[]) y.get(sf);
                for (String city2 : city){
                    System.out.println(city2 + " ");
                }
            }

        }
    }
}
